<template>
  <el-form ref="searchForm" :model="searchForm" label-width="100px" >
    <el-row  :gutter="10">
      <el-col :lg="6" :sm="8">
        <el-form-item label="类型">
          <el-select v-model="searchForm.type" placeholder="请选择">
            <el-option
                    v-for="item in statList"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :lg="6" :sm="8">
        <el-form-item label="金额" >
          <el-input v-model="searchForm.amount" :controls="false"></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="6" :sm="8">
        <el-button id="seaBtn" shape="circle" icon="md-search" @click="onSearch" type="primary">查询</el-button>
        <el-button id="resBtn" class="mainBtn" shape="circle" icon="md-sync" @click="onReset">重置</el-button>
      </el-col>
    </el-row>

  </el-form>
</template>
<script>
  export default {
    data () {
      return {
        searchForm: {
          type:'',
          amount: undefined,
        },
        statList:[
          {
            value: '0',
            label: '租金'
          },
          {
            value: '1',
            label: '设备'
          },
          {
            value: '2',
            label: '电费'
          },
          {
            value: '3',
            label: '其他'
          },
        ]
      }
    },
    methods: {
      onSearch () {
        this.$emit('on-search', this.searchForm)
      },
      onReset () {
          this.searchForm.type=''
          this.searchForm.amount= ''
      },

    },
    mounted () {

    }
  }
</script>

<style scoped>
</style>
